/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package apt;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author lhminh
 */
public class TinhTong02 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        int n = nhap();
        long s = tinhTong(n);
        System.out.println("Tong la: " + s);
    }

    public static int nhap() {
        try {
            InputStreamReader reader = new InputStreamReader(System.in);
            BufferedReader in = new BufferedReader(reader);

            String str = "";
            System.out.print("Nhap n: ");
            str = in.readLine();

            int n = Integer.parseInt(str);
            return n;
        } catch (IOException ex) {
            Logger.getLogger(TinhTong02.class.getName()).log(Level.SEVERE, null, ex);
            return -1;
        }
    }

    public static long tinhTong(int n) {
        int i = 1;
        long s = 0;
        while (i <= n) {
            s = s + i;
            //i = i + 1;
            i++;
        }
        
        return s;
    }
}
